{% stylesheet %}
.block_collection_image_text .collection_image_text {
  display: grid;
  grid-gap: 30px;
  grid-template-columns: repeat(2, 1fr);
}

@media screen and (max-width: 767px) {
  .block_collection_image_text .collection_image_text {
    grid-gap: 15px;
    grid-template-columns: repeat(1, 1fr);
  }
}

.block_collection_image_text .collection_image_text-item {
  width: 100%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 6px;
}

.block_collection_image_text .collection-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.block_collection_image_text .collection-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  padding: 30px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.4;
}

@media screen and (max-width: 767px) {
  .block_collection_image_text .collection-content {
    padding: 15px;
  }
}

.block_collection_image_text .collection-content .collection-content-label {
  font-size: 12px;
  color: var(--label_color);
}

.block_collection_image_text .collection-content .collection-content-title {
  font-size: 20px;
  color: var(--title_color);
}

.block_collection_image_text .collection-content .collection-content-detail {
  font-size: 14px;
  color: var(--detail_color);
}

.block_collection_image_text .collection-content .collection-content-btn {
  align-self: flex-start;
  font-size: 12px;
  padding: 4px 16px;
  color: var(--btn_color);
  border: 2px solid var(--btn_border_color);
  display: flex;
  align-items: center;
  position: relative;
}

.block_collection_image_text .collection-content .collection-content-btn svg {
  width: 12px;
  height: 12px;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: all .26s ease-in-out;
}

.block_collection_image_text .collection-content .collection-content-btn svg path {
  fill: var(--btn_color);
}

.block_collection_image_text .collection-content .collection-content-btn span {
  transition: all .26s ease-in-out;
}

.block_collection_image_text .collection-content .collection-content-btn:hover svg {
  opacity: 1;
  right: 5px;
}

.block_collection_image_text .collection-content .collection-content-btn:hover span {
  transform: translateX(-6px);
}

{% endstylesheet %}
{% assign blockId = block_id | default : section.block_id %}
{% assign defaultImageEmpty = 'empty-x.png' | public_asset_abs_url %}


<div class="block_collection_image_text container-wrapper">
  <div class="collection_image_text">
    {% for block in section.blocks %}
    {%- capture href -%}
      {% if block.herf.url != "" %}{{ block.herf.url | append: '?data_from=' | append: data_from }}{% else %}javascript:;{%endif%}
    {%- endcapture -%}
    {%- capture animation -%}
    {% assign indexModulo = forloop.index | modulo: 2  %}
    {%- if indexModulo == 0 -%}
      animation-move-right
      {%- else -%}
      animation-move-left
    {%- endif -%}
    {%- endcapture -%}
    
    
    <a class="collection_image_text-item animation-init" data-animation="animation-move-left" href="{{href}}" style="--title_color:{{block.title_color}};--label_color:{{block.label_color}};--detail_color:{{block.detail_color}};--btn_color:{{block.btn_color}};--btn_border_color:{{block.btn_border_color}}">
        <img class="collection-bg-image" src="{{defaultImageEmpty}}" data-src="{{block.bg_url.src}}" alt="{{block.bg_url.alt}}">
        <div class="collection-content">
          <p class="collection-content-label padding-bottom-12">{{block.label}}</p>
          <h2 class="collection-content-title padding-bottom-18">{{block.title}}</h2>
          <p class="collection-content-detail padding-bottom-24">{{block.detail}}</p>
          <div class="collection-content-btn">
            <span>{{block.btn_text}}</span>
            {% include 'icon_goya_back_right' %}
          </div>
        </div>
    </a>
    {% endfor %}
  </div>
</div>
{% schema %}
{
	"tag": "",
	"class": "block_collection_image_text",
	"is_global": false,
	"icon": "icon-tuwenliebiao",
	"name": {
		"zh_CN": "专辑图文"
	},
	"max_blocks": "6",
	"blocks": [
		{
			"name": {
				"zh_CN": "专辑图文列表"
			},
			"type": "collection_image_text-item",
			"settings": [
				{
					"type": "card_header",
					"label": {
						"zh_CN": "字体"
					}
				},
				{
					"type": "card_input",
					"label": {
						"zh_CN": "标题"
					},
					"default": "Clearance Sales",
					"id": "title"
				},
				{
					"type": "card_input",
					"label": {
						"zh_CN": "描述"
					},
					"id": "detail",
					"default": "Up to 70% Off & Free Shipping"
				},
				{
					"type": "card_input",
					"label": {
						"zh_CN": "标签"
					},
					"id": "label",
					"default": "Accessories"
				},
				{
					"type": "card_header",
					"label": {
						"zh_CN": "颜色"
					}
				},
				{
					"type": "card_color",
					"label": {
						"zh_CN": "标题颜色"
					},
					"id": "title_color",
					"default": "#282828"
				},
				{
					"type": "card_color",
					"label": {
						"zh_CN": "描述颜色"
					},
					"id": "detail_color",
					"default": "#686868"
				},
				{
					"type": "card_color",
					"label": {
						"zh_CN": "标签颜色"
					},
					"id": "label_color",
					"default": "#b9a16b"
				},
				{
					"type": "card_header",
					"label": {
						"zh_CN": "按钮设置"
					}
				},
				{
					"type": "card_input",
					"label": {
						"zh_CN": "按钮文字"
					},
					"id": "btn_text",
					"default": "All discount sales"
				},
				{
					"type": "card_color",
					"label": {
						"zh_CN": "按钮颜色"
					},
					"id": "btn_color",
					"default": "#282828"
				},
				{
					"type": "card_color",
					"label": {
						"zh_CN": "按钮边框"
					},
					"id": "btn_border_color",
					"default": "#282828"
				},
				{
					"type": "card_header",
					"label": {
						"zh_CN": "背景"
					}
				},
				{
					"type": "card_image",
					"label": {
						"zh_CN": "背景图片"
					},
					"default": {
						"src": "",
						"alt": ""
					},
					"info": {
						"zh_CN": "建议宽高比例为2:1，宽度800px以上"
					},
					"id": "bg_url"
				},
				{
					"type": "card_page_link",
					"label": {
						"zh_CN": "页面跳转"
					},
					"default": {
						"type": "",
						"title": "",
						"url": ""
					},
					"id": "herf"
				}
			]
		}
	],
	"settings": [
		{
			"type": "card_header",
			"label": {
				"zh_CN": "设置"
			}
		}
	],
	"default": {
		"settings": {},
		"blocks": [
			{
				"title": "Clearance Sales",
				"detail": "Up to 70% Off & Free Shipping",
				"label": "Accessories",
				"title_color": "#282828",
				"detail_color": "#686868",
				"label_color": "#b9a16b",
				"btn_text": "All discount sales",
				"btn_color": "#282828",
				"btn_border_color": "#282828",
				"bg_url": {
					"src": "",
					"alt": ""
				},
				"herf": {
					"type": "",
					"title": "",
					"url": ""
				},
				"block_type": "collection_image_text-item"
			},
			{
				"title": "Clearance Sales",
				"detail": "Up to 70% Off & Free Shipping",
				"label": "Accessories",
				"title_color": "#282828",
				"detail_color": "#686868",
				"label_color": "#b9a16b",
				"btn_text": "All discount sales",
				"btn_color": "#282828",
				"btn_border_color": "#282828",
				"bg_url": {
					"src": "",
					"alt": ""
				},
				"herf": {
					"type": "",
					"title": "",
					"url": ""
				},
				"block_type": "collection_image_text-item"
			}
		]
	}
}
{% endschema %}